import React from 'react'
import { Layout } from 'antd';
import RouterView from '../../router/routerView'
import Logo from '../../logo.png'
import MyMenu from '../../components/MyMenu'
const { Content, Footer, Sider } = Layout;

class SiderDemo extends React.Component {
  state = {
    collapsed: false,
  };

  onCollapse = collapsed => {
    console.log(collapsed);
    this.setState({ collapsed });
  };
  render() {
    const { collapsed } = this.state;
    const { routes } = this.props
    console.log(routes);
    return (
      <Layout style={{ minHeight: '100vh' }}>
        <Sider collapsible collapsed={collapsed} onCollapse={this.onCollapse}>
          <div className="logo" >
            <img src={Logo} alt="" width="50%" height="50%  " className="App-logo"/>
          </div>
          {/* 下拉导航组件 */}
          <MyMenu { ...this.props }></MyMenu>
        </Sider>
        <Layout className="site-layout">
          <Content style={{ margin: '0 16px' }}>
            <div className="site-layout-background" style={{ padding: 24, minHeight: 360 }}>
              <RouterView routes={ routes }></RouterView>
            </div>
          </Content>
          <Footer style={{ textAlign: 'center' }}>八维 ©2021 后台管理系统</Footer>
        </Layout>
      </Layout>
    );
  }
}


export default SiderDemo